import React, {Component} from 'react'
import {connect} from 'react-redux'
import {Redirect} from 'react-router-dom'

class Write extends Component {
    render() {
        const {loginStatus} = this.props
        if(loginStatus){
            return <div>
                你可以写文章了
            </div>
        }else{
            return <Redirect to='/login' />
        }
    }

}

const mapState = (status) => ({
    loginStatus: status.getIn(['login', 'loginStatus'])
})

export default connect(mapState, null)(Write)